package Demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 34255
 * Date: 2024-06-02
 * Time: 16:27
 */
public class Login {
    private String name;
    private String Password;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return Password;
    }

    public void setPassword(String password) {
        Password = password;
    }

    public void loginInfo(String name,String password)throws Username,UserPassword{
        if(!this.name.equals(name)){
            throw new Username("用户名错误");
//            System.out.println("用户名错误");
//            return;
        }
        if(!this.Password.equals(password)){
            throw new UserPassword("密码错误");
//            System.out.println("密码错误");
//            return;
        }
    }
}
